package com.east.sng.entity.param;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * @author east
 * @date: 2021/1/5
 * @Description: role receive param javabean
 **/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class MenuParam {

    @NotNull(message = "{param.id.notnull}")
    private Integer menuId;

    @NotBlank(message = "{menuparam.menuname.notblank}")
    private String menuName;

    @NotBlank(message = "{menuparam.url.notblank}")
    @Pattern(regexp = "^(/[a-zA-Z0-9]{0,62})+$",message = "{menuparam.url.pattern}")
    private String url;

    @NotBlank(message = "{menuparam.code.notblank}")
    @Pattern(regexp = "^[a-zA-Z]+:[a-zA-Z]+$",message = "{menuparam.code.pattern}")
    private String code;

    @NotBlank(message = "{menuparam.parentid.notblank}")
    @Pattern(regexp = "^([0-9]*){1,2}$",message = "{menuparam.parentid.notblank}")
    private String parentName;

    @NotBlank(message = "{menuparam.mlevel.notblank}")
    @Pattern(regexp = "^1|2$",message = "{menuparam.mlevel.notblank}")
    private String mlevel;

}

